function compose(f, g) {
  return function (...args) {
    return g(f.apply(this, args));
  };
}
const sum = (x, y) => x + y;
const square = (x) => x * x;
const r = compose(sum, square)(2, 3);
console.log(r); // 25
